home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / bbsutil / bbsamt40.zip / BANSI001.DOC < prev    next >
Text File  |  1994-04-18  |  23KB  |  626 lines

  1. copyright (c) 1994 by Paul Wheaton, Banana Programming
  2.  
  3. The ANSI-BBS industry is riddled with conflicts.  Since the true ANSI
  4. standard has not been strictly followed, a variety of variations have
  5. evolved.  Some have become popular.
  6.  
  7. This document spells out what BananaCom uses for it's terminal emulation: A
  8. mish-mash of ANSI, VT100, pseudo-ANSI and pseudo-VT100 that tries to follow
  9. what most modem services expect and use. Perhaps this will help to make
  10. BBS's and COM programs work together with a little less research and
  11. programming effort.
  12.  
  13. Terminal sends:
  14.  
  15.   All ASCII characters from 1 to 127 are sent as is.  If somebody wants to
  16.   feed a special character that comes through as a character 128 through
  17.   255, send that through too.
  18.  
  19.   Note that "Doorway mode" is a simple, beautiful thing developed by
  20.   Marshall Dudley that allows a user calling a modem service to run DOS
  21.   programs on the modem service! Look for DRWY*.* on your favorite modem
  22.   service or call Marshall Dudley's support BBS at (615)675-3282.  While
  23.   BananaCom is in Doorway Mode, all IBM PC extended keys send a NULL
  24.   character (ASCII value 0) followed by the scan code given by the BIOS.
  25.  
  26.   ANSI terminal emulation is supposed to be a superset of the escape
  27.   sequences used by the DEC VT100 terminal.  These required that an escape
  28.   (ASCII 27) be sent followed by some other characters.  The following
  29.   keystrokes are well established:
  30.  
  31.         Keystroke             Sent          Doorway mode
  32.  
  33.         left arrow key        ESC [ D         NULL 75
  34.         right arrow key       ESC [ C         NULL 77
  35.         up arrow key          ESC [ A         NULL 72
  36.         down arrow key        ESC [ B         NULL 80
  37.         home key              ESC [ H         NULL 71
  38.         end key               ESC [ K         NULL 79
  39.         ^home key             ESC [ L         NULL 119
  40.         ^page up              ESC [ M         NULL 132
  41.  
  42.         F1 key                ESC O P         NULL 59
  43.         F2 key                ESC O Q         NULL 60
  44.         F3 key                ESC O w         NULL 61
  45.         F4 key                ESC O x         NULL 62
  46.  
  47.           capital "oh", not a zero^            ^ASCII value 0
  48.  
  49.   All other keys send a NULL character (ASCII value 0) and then the BIOS
  50.   scan code (as a character, not multi digits representing the number).
  51.   Note that most com programs will use Alt-A through Alt-Z and Alt-1
  52.   through Alt-9 and Alt-0.  If there happens to be keys left they will be
  53.   passed through.
  54.  
  55.   Function keys are your best bet and are all passed through
  56.  
  57.                Alone        Shift         Ctrl         Alt
  58.  
  59.         F1                 NULL  84     NULL  94     NULL 104
  60.         F2                 NULL  85     NULL  95     NULL 105
  61.         F3                 NULL  86     NULL  96     NULL 106
  62.         F4                 NULL  87     NULL  97     NULL 107
  63.         F5    NULL  63     NULL  88     NULL  98     NULL 108
  64.         F6    NULL  64     NULL  89     NULL  99     NULL 109
  65.         F7    NULL  65     NULL  90     NULL 100     NULL 110
  66.         F8    NULL  66     NULL  91     NULL 101     NULL 111
  67.         F9    NULL  67     NULL  92     NULL 102     NULL 112
  68.         F10   NULL  68     NULL  93     NULL 103     NULL 113
  69.  
  70.    Some com programs use the Page Up and Page Down keys to initiate a file
  71.    transfer although this seems to be changing - these keys are of great
  72.    use to BBS's.
  73.  
  74.         Page Up           NULL  73
  75.         Page Down         NULL  81
  76.         Insert            NULL  82
  77.  
  78.    Note that when you press control-page-down with some terminal programs,
  79.    they send   ESC [ H ESC [ 2 J   and a lot of BBS's simply ignore that.
  80.  
  81.         ctrl-page-down    NULL 118
  82.         ctrl-end          NULL 117
  83.         ctrl-left-arrow   NULL 115
  84.         ctrl-right-arrow  NULL 116
  85.         shift-tab         NULL 15
  86.  
  87. Terminal receives:
  88.  
  89.   Most ANSI terminals use a screen 80x24 - with the last line reserved for
  90.   reporting the current status of the terminal program.  BananaCom uses
  91.   this standard.
  92.  
  93.   There are a few ASCII characters that have a special effect on the
  94.   terminal:
  95.  
  96.       Dec  Hex  char   function
  97.  
  98.        7    7    ^G    beep
  99.        8    8    ^H    destructive backspace
  100.        9    9    ^I    tab - move to next tab column (8,16,24,32,40...)
  101.       10    A    ^J    line feed - move down one. Scroll up if needed
  102.       12    C    ^L    clear screen (normal attribute) & home cursor (1,1)
  103.       13    D    ^M    return - move cursor to column 1
  104.  
  105.   Note that passing through a NULL (ASCII value 0), will force the next
  106.   character to be displayed on the screen and not interpretted.
  107.  
  108.   Example:
  109.  
  110.     Sending a ^L that is not preceeded by a NULL character will result in
  111.     clearing the screen.  Sending a NULL character and then ^L will result
  112.     in the female symbol appearing at the current cursor location.
  113.  
  114.  
  115.   Escape sequences do not have spaces in them.  Spaces have been added
  116.   here for readability.
  117.  
  118.   Anything appearing in angle brackets is an escape sequnce variable.  The
  119.   angle brackets are not sent.
  120.  
  121.  
  122.   ESC D    scroll up
  123.   ~~~~~~~~~~~~~~~~~~
  124.     All of the text on the screen (or the scrolling region, if one is
  125.     defined) is scrolled up one line.  The bottom line is filled with
  126.     spaces colored according to the current attribute.
  127.  
  128.     Note that there is no left bracket "[" between the ESC and the 'D'.
  129.  
  130.     Example:  ESC D              scroll all text up one line
  131.  
  132.  
  133.   ESC M    scroll down
  134.   ~~~~~~~~~~~~~~~~~~~~
  135.     All of the text on the screen (or the scrolling region, if one is
  136.     defined) is scrolled down one line.  The top line is filled with spaces
  137.     colored according to the current attribute.
  138.  
  139.     Note that there is no left bracket "[" between the ESC and the 'M'.
  140.  
  141.     Example:  ESC M              scroll all text down one line
  142.  
  143.  
  144.   ESC [ @    insert char
  145.   ~~~~~~~~~~~~~~~~~~~~~~
  146.     Insert a space into the current line at the current cursor position.
  147.     The character at column 80 is thrown out.  The current attribute is
  148.     used for the new space.
  149.  
  150.  
  151.   ESC [ <NumLines> A    cursor up
  152.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  153.     Move the cursor up specified number of lines (default is one).
  154.  
  155.     If "ESC [ ? 6 h" has been received since last "ESC [ <var> ; <var> r"
  156.     then the cursor will not be allowed to move beyond the top of the
  157.     scrolling region.
  158.  
  159.     Example:  ESC [ 1 0 A        move up ten lines
  160.  
  161.     Example:  ESC [ A            move up one line
  162.  
  163.  
  164.   ESC [ <NumLines> B    cursor down
  165.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  166.     Move the cursor down specified number of lines (default is one).
  167.  
  168.     If "ESC [ ? 6 h" has been received since last "ESC [ <var> ; <var> r"
  169.     then the cursor will not be allowed to move beyond the bottom of the
  170.     scrolling region.
  171.  
  172.     Example:  ESC [ 1 0 B        move down ten lines
  173.  
  174.     Example:  ESC [ B            move down one line
  175.  
  176.  
  177.   ESC [ <NumCols> C    cursor right
  178.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  179.     Move the cursor right specified number of lines (default is one).
  180.  
  181.     Example:  ESC [ 1 0 C        move right ten columns
  182.  
  183.     Example:  ESC [ C            move right one column
  184.  
  185.  
  186.   ESC [ <NumCols> D    cursor left
  187.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  188.     Move the cursor left specified number of lines (default is one).  Cannot
  189.     move beyond left of screen.
  190.  
  191.     Example:  ESC [ 1 0 D        move left ten columns
  192.  
  193.     Example:  ESC [ D            move left one column
  194.  
  195.  
  196.   ESC [ <Num> E    line feed
  197.   ~~~~~~~~~~~~~~~~~~~~~~~~~~
  198.     Convert to specified number of line feeds.  If the cursor is at the
  199.     bottom of the screen (or scrolling region if one is defined) text will
  200.     be scrolled up and the bottom line will be cleared.
  201.  
  202.     Example:  ESC [ 1 0 E        convert and process as ten linefeeds
  203.  
  204.     Example:  ESC [ E            convert and process as onr linefeed
  205.                                  (why not just send ^J ?)
  206.  
  207.  
  208.   ESC [ F    undefined
  209.   ESC [ G    undefined
  210.  
  211.  
  212.   ESC [ <row> ; <col> H    move to
  213.   ~~~~~~~~~~~~~~~~~